//package com.swak.rpc.proxy;
//
//import com.swak.spi.ExtensionLoader;
//
//public class ProxyFactory$Adaptive implements com.swak.rpc.proxy.ProxyFactory {
//	public java.lang.Object getProxy(com.swak.rpc.Invoker arg0) throws com.swak.exception.RpcException {
//		if (arg0 == null)
//			throw new IllegalArgumentException("com.swak.rpc.Invoker argument == null");
//		if (arg0.getUrl() == null)
//			throw new IllegalArgumentException("com.swak.rpc.Invoker argument getUrl() == null");
//		com.swak.registry.URL url = arg0.getUrl();
//		String extName = url.getParameter("proxy", "");
//		if (extName == null)
//			throw new IllegalStateException("Failed to get extension (com.swak.rpc.proxy.ProxyFactory) name from url ("
//					+ url.toString() + ") use keys([proxy])");
//		com.swak.rpc.proxy.ProxyFactory extension = (com.swak.rpc.proxy.ProxyFactory) ExtensionLoader
//				.getExtensionLoader(com.swak.rpc.proxy.ProxyFactory.class)
//				.load(extName, arg0.getClass().getClassLoader());
//		return extension.getProxy(arg0);
//	}
//
//	public com.swak.rpc.Invoker getInvoker(java.lang.Object arg0, java.lang.Class arg1, com.swak.registry.URL arg2)
//			throws com.swak.exception.RpcException {
//		if (arg2 == null)
//			throw new IllegalArgumentException("url == null");
//		com.swak.registry.URL url = arg2;
//		String extName = url.getParameter("proxy", "");
//		if (extName == null)
//			throw new IllegalStateException("Failed to get extension (com.swak.rpc.proxy.ProxyFactory) name from url ("
//					+ url.toString() + ") use keys([proxy])");
//		com.swak.rpc.proxy.ProxyFactory extension = (com.swak.rpc.proxy.ProxyFactory) ExtensionLoader
//				.getExtensionLoader(com.swak.rpc.proxy.ProxyFactory.class)
//				.load(extName, arg0.getClass().getClassLoader());
//		return extension.getInvoker(arg0, arg1, arg2);
//	}
//}
